<template>
	<view>
		<navView :navTitle="title" titleColor="#fff" :isBack="true"></navView>
		<view class="container">
			<image class="log" src="https://hfd.bjlzkj.com/static/user/log.png" mode="widthFix"></image>
			<image class="cheng" src="https://hfd.bjlzkj.com/static/user/cheng.png" mode="widthFix"></image>
			<rich-text :nodes="type == 1?detail1:detail2"></rich-text>
			<view class="btns">
				<view class="btn" v-if="type == 1" @tap="type = 2">
					<image src="https://hfd.bjlzkj.com/static/user/button.png" mode=""></image>
					<view>公司团队</view>
				</view>
				<view class="btn" v-if="type == 2" @tap="type = 1">
					<image src="https://hfd.bjlzkj.com/static/user/button.png" mode=""></image>
					<view>公司信息</view>
				</view>
				<view class="btn">
					<image src="https://hfd.bjlzkj.com/static/user/button.png" mode=""></image>
					<view>服务项目</view>
				</view>
				<view class="btn">
					<image src="https://hfd.bjlzkj.com/static/user/button.png" mode=""></image>
					<view>政策信息</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				detail1: '',
				detail2: '',
				type: 1,
				title: '公司信息'
			}
		},
		onLoad() {
			this.getDetail()
		},
		watch: {
			type(newVal, oldVal) {
				if (newVal == 1) {
					this.title = '公司信息'
				} else {
					this.title = '公司团队'
				}
			}
		},
		methods: {
			getDetail() {
				var userInfo = uni.getStorageSync('userInfo')
				this.$request('/addons/qingdong/company/getCompanyIntroduce', 'GET', {
					company_id: userInfo.company_id
				}).then(res => {
					this.detail1 = res.data[0].content
					this.detail2 = res.data[1].content
				})
			}
		}
	}
</script>

<style lang="scss">
	.container {
		width: 95%;
		box-sizing: border-box;
		margin: 0 auto;
		margin-top: 30rpx;
		padding: 20rpx;
		border-radius: 16rpx;
		background: #fff;
		position: relative;

		.log {
			position: absolute;
			width: 268rpx;
			height: 138rpx;
			left: 0;
			top: -20rpx;
		}

		.cheng {
			width: 422rpx;
			height: 198rpx;
			margin-left: 230rpx;
		}
	}

	.btns {
		position: fixed;
		right: 30rpx;
		bottom: 200rpx;

		.btn {
			position: relative;
			width: 234rpx;
			height: 70rpx;
			margin-top: 20rpx;

			image {
				position: absolute;
				width: 100%;
				height: 100%;
			}

			view {
				font-weight: 400;
				font-size: 30rpx;
				color: #FFFFFF;
				position: relative;
				width: 100%;
				padding-left: 30rpx;
				line-height: 70rpx;
				height: 70rpx;
			}
		}
	}
</style>